import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'
import dialog from '../components/dialog/dialogDetail'
import dialogList from '../components/dialogList/dialogList'
import search from '../components/search/search'
import address from '../components/address/address'
import addressDetail from '../components/address/address-detail/address-detail'
import addressMore from '../components/address/address-detail/address-more/address-more'
import find from '../components/find/find'
import friendcircle from '../components/find/friend-circle/friend-circle'
import scan from '../components/find/scan/scan'
import shake from '../components/find/shake/shake'
import me from '../components/me/me'
import money from '../components/me/money/money'
import collection from '../components/me/collection/collection'
import album from '../components/me/album/album'
import card from '../components/me/card/card'
import set from '../components/me/set/set'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/dialogList'
    },
    {
      path: '/dialogList',
      name: 'dialogList',
      component: dialogList
    },
    {
      path: '/dialog/:id',
      name: 'dialog',
      component: dialog
    },
    {
      path: '/search',
      name: 'search',
      component: search
    },
    {
      path: '/address', // 通讯录
      name: 'address',
      component: address,
      children: [
        {
          path: '/addressDetail/:id', // 传入不同的id,就可以跳转到不同的子路由
          name: 'addressDetail',
          component: addressDetail,
          children: [
            {
              path: '/addressMore/:id',
              name: 'addressMore',
              component: addressMore
            }
          ]
        }
      ]
    },
    {
      path: '/find', // 发现
      name: 'find',
      component: find,
      children: [
        {
          path: '/friendcircle',
          name: 'friendCircle',
          component: friendcircle
        },
        {
          path: '/scan',
          name: 'scan',
          component: scan
        },
        {
          path: '/shake',
          name: 'shake',
          component: shake
        }
      ]
    },
    {
      path: '/me', // 我
      name: 'me',
      component: me,
      children: [
        {
          path: '/money',
          name: 'money',
          component: money
        },
        {
          path: '/collection',
          name: 'collection',
          component: collection
        },
        {
          path: '/album',
          name: 'album',
          component: album
        },
        {
          path: '/card',
          name: 'card',
          component: card
        },
        {
          path: '/set',
          name: 'set',
          component: set
        }
      ]
    }
  ]
})
